From fd5728e2f98050a96d68e87cf323e0c9eb66186a Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Tue, 23 Dec 2025 15:09:09 +0100 Subject: [PATCH] layout: Drop fallback for hot corner without barriers The BARRIER backend capability was been moot for a long time since XInput 2.4 became widespread and barriers became commonplace. And even further recently with the removal of the X11 backend. The native backend has always implemented barriers. It seems we can drop this fallback handling. Since the _entered flag was only used in those paths, the leave event vfunc is unnecessary too. Part-of: --- js/ui/layout.js | 68 ------------------------------------------------- 1 file changed, 68 deletions(-) diff --git a/js/ui/layout.js b/js/ui/layout.js index d415e595d..e68780d0e 100644 --- a/js/ui/layout.js +++ b/js/ui/layout.js @@ -1144,19 +1144,11 @@ class HotCorner extends Clutter.Actor { _init(layoutManager, monitor, x, y) { super._init(); - // We use this flag to mark the case where the user has entered the - // hot corner and has not left both the hot corner and a surrounding - // guard area (the "environs"). This avoids triggering the hot corner - // multiple times due to an accidental jitter. - this._entered = false; - this._monitor = monitor; this._x = x; this._y = y; - this._setupFallbackCornerIfNeeded(layoutManager); - this._pressureBarrier = new PressureBarrier( HOT_CORNER_PRESSURE_THRESHOLD, HOT_CORNER_PRESSURE_TIMEOUT, @@ -1219,45 +1211,6 @@ class HotCorner extends Clutter.Actor { } } - _setupFallbackCornerIfNeeded(layoutManager) { - const {capabilities} = global.backend; - if ((capabilities & Meta.BackendCapabilities.BARRIERS) === 0) { - this.set({ - name: 'hot-corner-environs', - x: this._x, - y: this._y, - width: 3, - height: 3, - reactive: true, - }); - - this._corner = new Clutter.Actor({ - name: 'hot-corner', - width: 1, - height: 1, - opacity: 0, - reactive: true, - }); - this._corner._delegate = this; - - this.add_child(this._corner); - layoutManager.addChrome(this); - - if (Clutter.get_default_text_direction() === Clutter.TextDirection.RTL) { - this._corner.set_position(this.width - this._corner.width, 0); - this.set_pivot_point(1.0, 0.0); - this.translation_x = -this.width; - } else { - this._corner.set_position(0, 0); - } - - this._corner.connect('enter-event', - this._onCornerEntered.bind(this)); - this._corner.connect('leave-event', - this._onCornerLeft.bind(this)); - } - } - _onDestroy() { this.setBarrierSize(0); this._pressureBarrier.destroy(); @@ -1285,27 +1238,6 @@ class HotCorner extends Clutter.Actor { return DND.DragMotionResult.CONTINUE; } - - _onCornerEntered() { - if (!this._entered) { - this._entered = true; - this._toggleOverview(); - } - return Clutter.EVENT_PROPAGATE; - } - - _onCornerLeft(actor, event) { - if (event.get_related() !== this) - this._entered = false; - // Consume event, otherwise this will confuse onEnvironsLeft - return Clutter.EVENT_STOP; - } - - vfunc_leave_event(event) { - if (event.get_related() !== this._corner) - this._entered = false; - return Clutter.EVENT_PROPAGATE; - } }); export class PressureBarrier extends Signals.EventEmitter { -- 2.39.5